package com.geoserver.controller;

import com.geoserver.service.TreeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * FileName: PageController
 * Create by fengzheng on 2019/4/14 22:17
 * Description: 页面跳转控制
 */

@Controller
public class PageController {

    private TreeInfoService treeInfoService;

    @Autowired
    public PageController(TreeInfoService treeInfoService) {
        this.treeInfoService = treeInfoService;
    }

    @RequestMapping("/index")
    public String index(){
        return "view/index";
    }

    @PostMapping("/data")
    @ResponseBody
    public String treeInfo(int ID){
        return treeInfoService.findTreeInfo(ID);
    }
}
